import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PersonTargetCompletionVo, TaskCompletionVo } from '@/api/stat/statType';
import { TaskVO } from '@/api/task/task/types';
import { UserMessageVO } from '@/api/userMessage/userMessage/types';

/**
 * 查询 当月业绩目标完成度
 * @returns {*}
 */
export const statPersonTargetCompletion = (): AxiosPromise<PersonTargetCompletionVo> => {
  return request({
    url: '/oa/stat/personTargetCompletion',
    method: 'get'
  });
};

/**
 * 查询 当月任务完成度
 * @returns {*}
 */
export const statTaskCompletion = (): AxiosPromise<TaskCompletionVo> => {
  return request({
    url: '/oa/stat/taskCompletion',
    method: 'get'
  });
};

/**
 * 查询 当月任务完成度
 * @returns {*}
 */
export const selectTaskList = (): AxiosPromise<TaskVO> => {
  return request({
    url: '/oa/stat/selectTaskList',
    method: 'get'
  });
};

/**
 * 查询 未处理通知
 * @returns {*}
 */
export const selectUserMessage = (): AxiosPromise<UserMessageVO[]> => {
  return request({
    url: '/oa/stat/selectUserMessage',
    method: 'get'
  });
};

export const getEmployeeTaskProgress = (): AxiosPromise<[]> => {
  return request({
    url: '/oa/popup/api/task-progress-sse',
    method: 'get'
  });
};
